export default {
    data() {
        return {
            // 物流进度弹出框
            dialogLog: false,
            // 所有分类数据
            ordersList: [],
            // 查询参数
            queryInfo: {
                query: '',
                pagenum: 1,
                pagesize: 5
            },
            // 总数据
            total: 0,
            // 物流数据
            logisticsList: []
        }
    },
    created() {
        this.getOrdersList();
    },
    methods: {
        // 查询所有订单数据
        async getOrdersList() {
            let {
                data: res
            } = await this.$http.get('orders', {
                params: this.queryInfo
            });
            if (res.meta.status != 200) return this.$message.error('获取订单数据失败');
            this.ordersList = res.data.goods;
            this.total = res.data.total;
        },
        // 查询物流信息
        async searchOgistics() {
            this.dialogLog = true;
            let {
                data: res
            } = await this.$http.get('/kuaidi/619915933338');
            this.logisticsList = res.data;
        },
        handleSizeChange(val) {
            // console.log(`每页 ${val} 条`);
            this.queryInfo.pagesize = val;
            this.getOrdersList()
        },
        handleCurrentChange(val) {
            // console.log(`当前页: ${val}`);
            this.queryInfo.pagenum = val;
            this.getOrdersList();
        }
    },
}